package lab02.test22;

/**
 * Created by ASUS on 2017/10/26.
 */
public class Test {

    public static void main(String[] args) {

        //给定一个字符串，将字符串中的所有大写字母变成小写字母
        // 数字用0 来代替，其他符号用#代替

        String result = "Hello,World!123";

        //最终结果：hello#world#000

        char tmp;

        int i;

        for (i = 0; i < result.length(); i ++){

            tmp = result.charAt(i);

            if (tmp >= 'A' && tmp <= 'Z'){
                //强制类型转换
                System.out.print((char)(tmp + 32));

            }else if(tmp >= '0' && tmp <= '9'){
                System.out.print( 0);

            }else if (tmp >='a' && tmp <= 'z'){
                System.out.print(tmp);
            }else{

                System.out.print("#");
            }
        }
    }
}
